package com.topscore.uke.network.retrofit;


import com.topscore.uke.entities.AchievementInfo;
import com.topscore.uke.entities.ActivitiesDetailBean;
import com.topscore.uke.entities.ActivitiesNewsData;
import com.topscore.uke.entities.AddressListItem;
import com.topscore.uke.entities.BuyOneGetOneItem;
import com.topscore.uke.entities.CommodityData;
import com.topscore.uke.entities.CouponInfo;
import com.topscore.uke.entities.DistrictBean;
import com.topscore.uke.entities.HomeBannerInfo;
import com.topscore.uke.entities.HotWordItem;
import com.topscore.uke.entities.MemberBasicInfo;
import com.topscore.uke.entities.MemberBodyData;
import com.topscore.uke.entities.MemberCommentsInfo;
import com.topscore.uke.entities.MemberConsumpInfo;
import com.topscore.uke.entities.MemberEntity;
import com.topscore.uke.entities.MemberMobPosInfo;
import com.topscore.uke.entities.MemberTagEntity;
import com.topscore.uke.entities.MyPerformanceSummaryData;
import com.topscore.uke.entities.PerformanceData;
import com.topscore.uke.entities.ProductDetailBean;
import com.topscore.uke.entities.SalesRankingItem;
import com.topscore.uke.entities.StaffInfoEntity;
import com.topscore.uke.entities.StuffListEntity;
import com.topscore.uke.entities.TeamMemberItem;
import com.topscore.uke.entities.TeamPerfomenceSummaryData;
import com.topscore.uke.entities.TeamPerformanceListEntity;
import com.topscore.uke.entities.TeamPerformanceRankData;
import com.topscore.uke.entities.TeamStaffData;
import com.topscore.uke.entities.UkePerformanceData;
import com.topscore.uke.entities.UserInfo;
import com.topscore.uke.entities.UserSalesInfo;
import com.topscore.uke.entities.VisitorChartBean;
import com.topscore.uke.entities.VisitorSourceEntity;
import com.topscore.uke.network.BaseResponse;
import com.topscore.uke.network.ServerUrl;
import com.topscore.uke.network.request.GetMemberCommentsRequest;
import com.topscore.uke.network.request.GetStuffListRequest;
import com.topscore.uke.network.request.GetTeamPerformanceRequest;
import com.topscore.uke.network.request.GetTeamRankRequest;
import com.topscore.uke.network.request.GetTeamSalesRequest;
import com.topscore.uke.network.request.GetVisitorSourceRequest;
import com.topscore.uke.network.request.GetVisitorsChartRequest;
import com.topscore.uke.network.request.GroupStaffRequest;
import com.topscore.uke.network.request.LoginBean;
import com.topscore.uke.network.request.MemberConsumpRequest;
import com.topscore.uke.network.request.MemberInfoUpdateRequest;
import com.topscore.uke.network.request.PostBodyDataRequest;
import com.topscore.uke.network.request.SaveMemberAddressRequest;
import com.topscore.uke.network.request.UpdateAddressRequest;

import java.util.List;
import java.util.Map;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

/**
 * Created by 71468 on 2017/9/12.
 */

public interface ApiService {
    @POST(ServerUrl._Login)
    Observable<BaseResponse<UserInfo>> login(@Body LoginBean request);

    @GET(ServerUrl._GetSmsCode)
    Observable<BaseResponse> getSmsCode(@Path("phone") String phone);

    @POST(ServerUrl._GroupList)
    Observable<BaseResponse<TeamStaffData>> getGroup(@Body GroupStaffRequest request);

    @GET(ServerUrl._GetStaffInfo)
    Observable<BaseResponse> getStaffInfo(@Path("userId") String userId, @Path("groupCode") String groupCode);

    @GET(ServerUrl._GetMemberAddressList)
    Observable<BaseResponse<List<AddressListItem>>> getMemberAddressList(@Path("phone") String phone);

    @POST(ServerUrl._PostMemberAddress)
    Observable<BaseResponse> postOrUpdateMemberAddress(@Body UpdateAddressRequest request);

    @GET(ServerUrl._GetBodyDataByPhone)
    Observable<BaseResponse<MemberBodyData>> getBodyData(@Path("phone") String phone);

    @POST(ServerUrl._PostBodyData)
    Observable<BaseResponse> postBodyData(@Body PostBodyDataRequest request);

    @GET(ServerUrl._GetTeamPerformanceInMonth)
    Observable<BaseResponse<PerformanceData>> getTeamPerformanceInMonth(@Path("dateStr") String date, @Path("shareUserGroupCode") String groupCode);

    @GET(ServerUrl._GetTeamPerformanceInYear)
    Observable<BaseResponse<PerformanceData>> getTeamPerformanceInYear(@Path("dateStr") String date, @Path("shareUserGroupCode") String groupCode);

    @POST(ServerUrl._GetTeamSalesRankList)
    Observable<BaseResponse<List<TeamPerformanceListEntity>>> getTeamSalesList(@Body GetTeamSalesRequest request);

    @POST(ServerUrl._GetTeamPerformance)
    Observable<BaseResponse<TeamPerfomenceSummaryData>> getTeamPerformance(@Body GetTeamPerformanceRequest request);

    @POST(ServerUrl._GetTeamRank)
    Observable<BaseResponse<TeamPerformanceRankData>> getTeamRankList(@Body GetTeamRankRequest request);

    @POST(ServerUrl._UpdateMemberInfo)
    Observable<BaseResponse> updateMemberInfo(@Body MemberInfoUpdateRequest request);

    /**
     * 获取访客数量图表数据
     *
     * @param request
     */
    @POST(ServerUrl._GetVisitorCount)
    Observable<BaseResponse<List<VisitorChartBean>>> getVisitorsCount(@Body GetVisitorsChartRequest request);

    /**
     * 获取访客来源及数量
     *
     * @param request
     */
    @POST(ServerUrl._GetVisitorSource)
    Observable<BaseResponse<List<VisitorSourceEntity>>> getVisitorSource(@Body GetVisitorSourceRequest request);

    /**
     * 获取销售订单个人业绩图表数据
     */
    @GET(ServerUrl._GetMyPerformanceChartData)
    Observable<BaseResponse<MyPerformanceSummaryData>> getMyPerformanceChartData(@Path("shareUserNo") String userId);

    @POST(ServerUrl._GetSalesRankingTop15List)
    Observable<BaseResponse<List<SalesRankingItem>>> getSalesRankingListTop15(@Body Map<String, Object> request);

    /**
     * 获取最近销售排行榜top15
     */
    @GET(ServerUrl._GetPersonalSalesRankList)
    Observable<BaseResponse<List<SalesRankingItem>>> getPersonalSalesRank(@Path("shareUserId") String userId, @Path("sortName") String sortName);

    @GET(ServerUrl._GetMemberList)
    Observable<BaseResponse<List<MemberEntity>>> getMemberList(@Path("userId") String userID, @Path("role") String role);

    @GET(ServerUrl._GetMemberMobPosInfo)
    Observable<BaseResponse<MemberMobPosInfo>> getMemberMobPosInfo(@Path("phone") String phone);

    @GET(ServerUrl._GetMemberDetailInfo)
    Observable<BaseResponse<MemberBasicInfo>> getMemberDetail(@Path("id") String id);

    @GET(ServerUrl._GetMemberTagsInfo)
    Observable<BaseResponse<List<MemberTagEntity>>> getMemberTagsInfo(@Path("id") String id);

    @POST(ServerUrl._SaveMemberAddress)
    Observable<BaseResponse> saveMemberAddress(@Body SaveMemberAddressRequest request);

    @GET(ServerUrl._GetDistrictInfo)
    Observable<BaseResponse<List<DistrictBean>>> getDistrictInfo(@Path("cityID") String cityId);

    @GET(ServerUrl._DeleteMemberAddressItem)
    Observable<BaseResponse> deleteMemberAddressItem(@Path("addressID") String id);

    @GET(ServerUrl._GetProductPage)
    Observable<BaseResponse<List<CommodityData>>> getCommodityPageData();

    @POST(ServerUrl._GetStuffListData)
    Observable<BaseResponse<StuffListEntity>> getStuffListData(@Body GetStuffListRequest request);

    /**
     * 获取商品搜索热词
     */
    @GET(ServerUrl._GetHotWord)
    Observable<BaseResponse<List<HotWordItem>>> getHotWord();

    @GET(ServerUrl._GetHomePageBanner)
    Observable<BaseResponse<List<HomeBannerInfo>>> getHomeBanner();

    @GET(ServerUrl._GetMemberCount)
    Observable<BaseResponse<Integer>> getMemberNumber(@Path("role") String role, @Path("userId") String loginName);

    @POST(ServerUrl._GetAchievement)
    Observable<BaseResponse<AchievementInfo>> getAchievement(@Body Map<String, Object> request);

    @GET(ServerUrl._GetCouponInfo)
    Observable<BaseResponse<List<CouponInfo>>> getCouponInfo(@Path("loginName") String loginName, @Path("status") String status);

    @POST(ServerUrl._GetActivities)
    Observable<BaseResponse<ActivitiesNewsData>> getActivities(@Body Map<String, Object> request);

    @POST(ServerUrl._GetTeamStaffList)
    Observable<BaseResponse<List<TeamMemberItem>>> getMyTeamStaffList(@Body Map<String, Object> request);

    @GET(ServerUrl._GetUserInfo)
    Observable<BaseResponse<StaffInfoEntity>> getUserInformation(@Path("loginName") String loginName, @Path("role") String role);

    @GET(ServerUrl._GetProductDetail)
    Observable<BaseResponse<ProductDetailBean>> getProductDetailInfo(@Path("id") String id);

    @POST(ServerUrl._GetCommentList)
    Observable<BaseResponse<MemberCommentsInfo>> getMemberComments(@Body GetMemberCommentsRequest request);

    @GET(ServerUrl._GetActivitiesDetail)
    Observable<BaseResponse<ActivitiesDetailBean>> getNewsDetail(@Path("empNum") String loginName, @Path("titleCode") String titleCode);

    @POST(ServerUrl._GetMemberConsump)
    Observable<BaseResponse<MemberConsumpInfo>> getMemberConsump(@Body MemberConsumpRequest request);

    @GET(ServerUrl._GetUserSales)
    Observable<BaseResponse<UserSalesInfo>> getUserSales(@Path("loginName") String loginName);

    @POST(ServerUrl._GetUkePerformance)
    Observable<BaseResponse<UkePerformanceData>> getUkePerformance(@Body Map<String, Object> request);

    @POST(ServerUrl._BuyOneGetOne)
    Observable<BaseResponse<List<BuyOneGetOneItem>>> getBuyOneGetOneData(@Body Map<String, Object> request);
}
